package your_car_status

class MechanicalTechnician {

    int id
    String name
    String username
    String speciality
    String phone
    String address
    String password
    String confirmPassword
    
    static belongsTo = [repairShop: RepairShop]
    
    static constraints = {
        id blank : false , unique : true
        name blank : false
        username unique : true
        speciality blank : false
        address blank : false
        phone blank : false , size : 7..10
       password(blank: false, size: 5..15 , password:true, validator: {password, obj ->
         def confirmPassword = obj.properties['confirmPassword']
         if(confirmPassword == null) return true // skip matching password validation (only important when setting/resetting pass)
         confirmPassword == password ? true : ['invalid.matchingpasswords']
     })
        confirmPassword blank: false, size: 5..15 , password:true
    }
    
}